#pragma once

#include <vector>

class GameControls;
class ServiceProvider;
class Menu;

class MenuManager
{
public:

	typedef std::vector<Menu*> MenuStack;

	MenuManager(ServiceProvider* i_sp, GameControls* i_gc);
	~MenuManager();

	void PushMenu(Menu* i_menu);
	void PopMenu();
	void SetMenu(Menu* i_menu);
	void Run();

	Menu* GetStartingMenu();
	Menu* GetTeamSelectionMenu();
	Menu* GetMainMenu();
	Menu* GetTeamsManagementMenu();	
	Menu* GetPlayerSelectionMenu();
	Menu* GetClassificationMenu();
	Menu* GetTurnsMenu();
	Menu* GetTeamsStatsMenu();
	Menu* GetPlayersStatsMenu();
	Menu* GetPlayersStatsShowMenu();
	Menu* GetEditFormationMenu();
	Menu* GetViewTeamsFormationMenu();
	Menu* GetPlayTurnsMenu();
	Menu* GetMarketMenu();
	Menu* GetLoadMenu();
	Menu* GetSaveMenu();
	Menu* GetEndLeagueMenu();
	Menu* GetConfirmPanelMenu();
	Menu* GetGameOverMenu();

	GameControls* GetGameControls() { return m_gc; }
	ServiceProvider* GetServiceProvider() { return m_sp; }

private:
	
	GameControls* m_gc;
	ServiceProvider* m_sp;

	Menu* m_currentMenu;
	MenuStack m_menuStack;
	
	Menu* m_startingMenu;
	Menu* m_teamSelectionMenu;
	Menu* m_mainMenu;
	Menu* m_teamsManagementMenu;
	Menu* m_playerSelectionMenu;
	Menu* m_classificationMenu;
	Menu* m_playersStatsMenu;
	Menu* m_playersStatsShowMenu;
	Menu* m_turnsMenu;
	Menu* m_teamsStatsMenu;
	Menu* m_editFormationMenu;
	Menu* m_viewTeamsFormationMenu;
	Menu* m_playTurnsMenu;
	Menu* m_marketMenu;
	Menu* m_loadMenu;
	Menu* m_saveMenu;
	Menu* m_endLeagueMenu;
	Menu* m_confirmPanelMenu;
	Menu* m_gameOverMenu;
};

#include "MenuManager.inl"